CXXFLAGS = -O2 -g -Wall -fmessage-length=0

COMPILER_EXE = g++ $(CXXFLAGS)

SRC = src

BIN = bin

INCLUDES_SUBFOLDERS = -I $(SRC)/support -I $(SRC)/support/handlers -I $(SRC)/dataunits -I $(SRC)/processes -I $(SRC)/contexts -I $(SRC)/model

OBJS = MoveToFront.o LevelContext.o AbstractContext.o CharDataUnit.o Logging.o Coder.o Decoder.o CodingLogicProvider.o StructModel.o CommandLineProcess.o DataInputOutput.o CompressionProcess.o CompressArgumentHandler.o DecompressArgumentHandler.o BlockSorting.o LoggingArgumentHandler.o Vavoom.o

LIBS = 

TARGET = Vavoom

LoggingArgumentHandler.o : $(SRC)/support/handlers/LoggingArgumentHandler.h $(SRC)/support/handlers/LoggingArgumentHandler.cpp
	$(COMPILER_EXE) -c $(SRC)/support/handlers/LoggingArgumentHandler.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/LoggingArgumentHandler.o

MoveToFront.o : $(SRC)/processes/TransformationProcess.h $(SRC)/processes/MoveToFront.h $(SRC)/processes/MoveToFront.cpp
	$(COMPILER_EXE) -c $(SRC)/processes/MoveToFront.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/MoveToFront.o

BlockSorting.o : $(SRC)/processes/BlockSorting.h $(SRC)/processes/BlockSorting.h $(SRC)/processes/BlockSorting.cpp
	$(COMPILER_EXE) -c $(SRC)/processes/BlockSorting.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/BlockSorting.o

CharDataUnit.o : $(SRC)/dataunits/DataUnit.h $(SRC)/dataunits/CharDataUnit.h $(SRC)/dataunits/CharDataUnit.cpp
	$(COMPILER_EXE) -c $(SRC)/dataunits/CharDataUnit.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/CharDataUnit.o

AbstractContext.o : $(SRC)/contexts/AbstractContext.h $(SRC)/contexts/AbstractContext.cpp
	$(COMPILER_EXE) -c $(SRC)/contexts/AbstractContext.cpp -I $(INCLUDES_SUBFOLDERS) -o $(BIN)/AbstractContext.o

LevelContext.o : $(SRC)/contexts/LevelContext.h $(SRC)/contexts/LevelContext.cpp
	$(COMPILER_EXE) -c $(SRC)/contexts/LevelContext.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/LevelContext.o	

CommandLineProcess.o : $(SRC)/support/CommandLineProcess.h $(SRC)/support/CommandLineProcess.cpp
	$(COMPILER_EXE) -c $(SRC)/support/CommandLineProcess.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/CommandLineProcess.o

Logging.o : $(SRC)/support/Logging.h $(SRC)/support/Logging.cpp
	$(COMPILER_EXE) -c $(SRC)/support/Logging.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/Logging.o

Decoder.o : $(SRC)/model/Decoder.h $(SRC)/model/Decoder.cpp
	$(COMPILER_EXE) -c $(SRC)/model/Decoder.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/Decoder.o

Coder.o : $(SRC)/model/Coder.h $(SRC)/model/Coder.cpp
	$(COMPILER_EXE) -c $(SRC)/model/Coder.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/Coder.o

CodingLogicProvider.o : $(SRC)/model/CodingLogicProvider.h $(SRC)/model/CodingLogicProvider.cpp
	$(COMPILER_EXE) -c $(SRC)/model/CodingLogicProvider.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/CodingLogicProvider.o

StructModel.o : $(SRC)/model/StructModel.h $(SRC)/model/StructModel.cpp
	$(COMPILER_EXE) -c $(SRC)/model/StructModel.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/StructModel.o

DataInputOutput.o : $(SRC)/dataunits/DataInputOutput.h $(SRC)/dataunits/DataInputOutput.cpp
	$(COMPILER_EXE) -c $(SRC)/dataunits/DataInputOutput.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/DataInputOutput.o

CompressionProcess.o : $(SRC)/processes/CompressionProcess.h $(SRC)/processes/CompressionProcess.cpp
	$(COMPILER_EXE) -c $(SRC)/processes/CompressionProcess.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/CompressionProcess.o
	
CompressArgumentHandler.o : $(SRC)/support/handlers/CompressArgumentHandler.h $(SRC)/support/handlers/CompressArgumentHandler.cpp
	$(COMPILER_EXE) -c $(SRC)/support/handlers/CompressArgumentHandler.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/CompressArgumentHandler.o

DecompressArgumentHandler.o : $(SRC)/support/handlers/DecompressArgumentHandler.h $(SRC)/support/handlers/DecompressArgumentHandler.cpp
	$(COMPILER_EXE) -c $(SRC)/support/handlers/DecompressArgumentHandler.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/DecompressArgumentHandler.o

Vavoom.o : $(SRC)/Vavoom.cpp
	$(COMPILER_EXE) -c $(SRC)/Vavoom.cpp $(INCLUDES_SUBFOLDERS) -o $(BIN)/Vavoom.o
	


$(TARGET):	$(OBJS)
	$(CXX) $(BIN)/*.o $(INCLUDES_SUBFOLDERS) $(LIBS) -o $(BIN)/$(TARGET) 

all:	$(TARGET)

clean:
	rm -f $(BIN)/*.o $(BIN)/$(TARGET)  
